package com.chenfan.process.util;

import com.chenfan.process.common.constants.ProcessConstants;
import com.chenfan.process.entity.po.ProcessInstanceApprovePo;

import java.util.List;
import java.util.Objects;

/**
 * @author K
 * @date 2022/7/11 5:18 PM
 */
public class ProcessUtil {
    private ProcessUtil() {}

    public static boolean department(String associateId) {
        return ProcessConstants.DEFAULT_SKIP_CHECK_PERMISSION_USER_ID.equals(associateId);
    }

    public static boolean optional(String associateId) {
        return ProcessConstants.NOT_SPECIFIC_NODE.equals(associateId);
    }

    public static boolean orSign(Long nextProcessId) {
        return Objects.equals(nextProcessId, ProcessConstants.OR_SIGN_NODE);
    }

    public static boolean counterSign(Long nextProcessId) {
        return Objects.equals(nextProcessId, ProcessConstants.COUNTER_SIGN_NODE);
    }

    public static boolean last(String currentNode) {
        return Objects.equals(currentNode, ProcessConstants.DEFAULT_NONE_NODE);
    }
}
